<template>
	<view class="root" :style="{height:screenHeight+'px'}">
		<!-- <view class="bgClass"></view> -->
		<view class="myCard">
			<view style="align-self: center;">
				<image class="profilephoto" src="/static/logo.png"></image>
			</view>
			
			<!-- <view class="nickName">李四</view> -->
			<view class="phone">{{loginInfo.userinfo.user.nickName}}</view>
		</view>

		<view class="list-container">
			<uni-list>
				<uni-list-item showArrow title="公示" clickable @click="toAnnouncementList"/>
				<uni-list-item showArrow title="待签约" v-if="loginInfo.userinfo.user.roles[0].id === 932" clickable @click="toSigningList"/>
				<uni-list-item showArrow title="已签约" v-if="loginInfo.userinfo.user.roles[0].id === 932" clickable @click="toSignedList"/>
				<uni-list-item showArrow title="待评估(居家)" v-if="loginInfo.userinfo.user.roles[0].id === 860" clickable @click="toHomeAssessList"/>
				<uni-list-item showArrow title="待评估(机构)" v-if="loginInfo.userinfo.user.roles[0].id === 860" clickable @click="toOrganizationAssessList"/>
				<uni-list-item showArrow title="已评估" v-if="loginInfo.userinfo.user.roles[0].id === 860" clickable @click="toAssessedList"/>
				<uni-list-item showArrow title="待审核(居家)" v-if="loginInfo.userinfo.user.roles[0].id === 295" clickable @click="toAuditList"/>
				<uni-list-item showArrow title="待审核(机构)" v-if="loginInfo.userinfo.user.roles[0].id === 295" clickable @click="toAuditOrgList"/>
				<uni-list-item showArrow title="已审核" v-if="loginInfo.userinfo.user.roles[0].id === 295" clickable @click="toAuditedList"/>
				<uni-list-item showArrow title="待护理" v-if="loginInfo.userinfo.user.roles[0].id === 916" clickable @click="toNursingList"/>
				<uni-list-item showArrow title="已护理" v-if="loginInfo.userinfo.user.roles[0].id === 916" clickable @click="toNursingListEnd"/>
			<!-- 	<uni-list-item showArrow title="人脸识别" v-if="loginInfo.userinfo.user.roles[0].id === 916" clickable @click="toFaceRecognition"/> -->
				<uni-list-item showArrow title="修改密码" clickable @click="toUpdataPwd"/>
				<uni-list-item showArrow title="退出登录" @click="unLogin" clickable/>
			</uni-list>
		</view>
	</view>
</template>


<script lang="ts">
	import { StorageUtil } from '@/storage/StorageUtil'
	import { route } from "@/route/Route"
	export default {
		components: {},
		data() {
			return {
				loginInfo:{}
			}
		},
		onLoad() {
			uni.setNavigationBarTitle({
				title: "首页"
			})
			// #ifdef MP-WEIXIN  
			if(wx.hideHomeButton){  
			    wx.hideHomeButton();  
			}  
			// #endif
			this.loginInfo = StorageUtil.getStorage(StorageUtil.USER)
		},
		methods: {
			toSigningList(){
				route.navigateTo({name:'signingList'})
			},
			toSignedList(){
				route.navigateTo({name:'signedList'})
			},
			toHomeAssessList(){
				route.navigateTo({name:'assessList'})
			},
			toOrganizationAssessList(){
				route.navigateTo({name:'assessOrgList'})
			},
			toAssessedList(){
				route.navigateTo({name:'assessedList'})
			},
			toAuditList(){
				route.navigateTo({name:'auditList'})
			},
			toAuditOrgList(){
				route.navigateTo({name:'toAuditOrgList'})
			},
			toAuditedList(){
				route.navigateTo({name:'auditedList'})
			},
			toAnnouncementList(){
				route.navigateTo({name:'announcementList'})
			},
			toNursingList(){
				route.navigateTo({name:'nursingList'})
			},
			toNursingListEnd(){
				route.navigateTo({name:'nursingListEnd'})
			},
			toFaceRecognition(){
				route.navigateTo({name:'faceRecognition'})
			},
			toUpdataPwd(){
				route.navigateTo({name:'updataPwd'})
			},
			unLogin(){
				uni.showModal({
					title: '提示',
					content: '是否确认退出登录',
					success: function (res) {
						if (res.confirm) {
							
							StorageUtil.setStorage(StorageUtil.TOKEN,"")
							StorageUtil.setStorage(StorageUtil.USER_ID,"")
							StorageUtil.setStorage(StorageUtil.USER,{})
							route.reLaunchTo({name:'login'})
						} else if (res.cancel) {
						}
					}
				});
			}
		}
	}
</script>


<style lang="scss">
.root{
	display: flex;
	flex-direction: column;
	background-color: $uni-bg-color-grey;
}

.myCard{
	// margin-top: 75rpx;
	display: flex;
	flex-direction: column;
	background-image:linear-gradient(to bottom right,#2979ff,#05DFC7);
}
.profilephoto{
	width: 150rpx;
	height: 150rpx;
	margin-top: 50rpx;
}

.nickName{
	align-self: center;
	color: $uni-white;
	margin-top: 15px;
	font-weight: 600;
	font-size: 88rpx;
}

.phone{
	align-self: center;
	color: $uni-white;
	margin-top: 10px;
	margin-bottom: 50rpx;
	font-size: 48rpx;
}

.list-container{
	margin-top: 100rpx;
	width: 700rpx;
	align-self: center;
	border-radius: 10rpx;
}
</style>

